import 'package:flutter/material.dart';
import 'package:flutter_app/config/colorconfig.dart';

class collectPage extends StatefulWidget {
  collectPage({Key key}) : super(key: key);

  @override
  _collectPageState createState() => _collectPageState();
}

class _collectPageState extends State<collectPage> {
  Widget _getGridList(contest, index) {
    return Container(
      color: defaultgreen,
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          iconTheme: IconThemeData(
            color: Colors.grey,
          ),
          centerTitle: true,
          title: Text(
            "收藏",
            style: TextStyle(color: Colors.black),
          ),
          elevation: 0,
          backgroundColor: Colors.white,
        ),
        body: Column(children: <Widget>[
          PreferredSize(
              preferredSize: Size(50, 500),
              child: Column(
                children: <Widget>[
                  Padding(
                    padding: EdgeInsets.fromLTRB(15, 10, 15, 5),
                    child: FlatButton(
                      onPressed: () {},
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.all(Radius.circular(20))),
                      color: defaultyellow,
                      child: Container(
                        width: double.infinity,
                        height: 30,
                        alignment: Alignment.center,
                        child: Text("搜索全部粉丝"),
                      ),
                    ),
                  ),
                ],
              )),
          Expanded(
            child: GridView.builder(
              physics: BouncingScrollPhysics(),
              shrinkWrap: true,
              padding: EdgeInsets.all(10),
              gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                  crossAxisCount: 2,
                  childAspectRatio: 0.7,
                  crossAxisSpacing: 10,
                  mainAxisSpacing: 10),
              itemCount: 15,
              itemBuilder: _getGridList,
            ),
          ),
        ]));
  }
}
